<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Intro</title>
    <link href="0_Site.css" rel="stylesheet" type="text/css" />
</head>
<body>
 
    <div id="pageContent">
 
        <h1>ASP.NET Bookstore</h1>
 
        <div id="bookContainer"></div>
 
    </div>
 
    <script id="bookTemplate" type="text/x-jQuery-tmpl">
        <div>
            <img src="BookPictures/${picture}" alt="" />
            <h2>${title}</h2>
            price: ${formatPrice(price)}
        </div>
    </script>
 
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.4.4.js"></script>
    <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.js"></script>
 
    <script type="text/javascript">
        // Create an array of books
        var books = [
            { title: "ASP.NET 4 Unleashed", price: 37.79, picture: "AspNet4Unleashed.jpg" },
            { title: "ASP.NET MVC Unleashed", price: 44.99, picture: "AspNetMvcUnleashed.jpg" },
            { title: "ASP.NET Kick Start", price: 4.00, picture: "AspNetKickStart.jpg" },
            { title: "ASP.NET MVC Unleashed iPhone", price: 44.99, picture: "AspNetMvcUnleashedIPhone.jpg" },
        ];
 
        // Render the books using the template
        $("#bookTemplate").tmpl(books).appendTo("#bookContainer");
 
        function formatPrice(price) {
            return "$" + price.toFixed(2);
        }
 
    </script>
 
</body>
</html>
